package com.ian.offer;

/**
 * @author zhangyaowen
 * @date 2021/2/21 1:49 下午
 */
public class ReplaceSpace {

    public String replaceSpace(String s) {

        int N = s.length();

        StringBuilder b = new StringBuilder();

        int i =0;
        while(i <N){
            b.append(s.charAt(i)==' '?"%20":s.charAt(i));
            i++;
        }

        return  b.toString();
    }
}
